<%@ page import="org.ibiblio.terasaur.item.Collection" %>
<html>
    <head>
        <meta name="layout" content="thin_sidebar" />
        <g:set var="entityName" value="${message(code: 'collection.label', default: 'Collection')}" />
        <content tag="title">Collection: ${collectionInstance?.name}</content>
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><g:link class="list" action="list"><g:message code="default.list.label" args="[entityName]" /></g:link></span> |
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
        <div class="clear"></div>
        <div class="rule"><hr /></div>

        <div class="body hentry">
            <h2 class="entry-title full-title">Collection: ${collectionInstance?.name}</h2>
            <span><a href="${browseUrl}">See items in this collection</a></span><br/><br/>
            <div class="clear"></div>

            <div id="item-details" class="full full-content">
                <div>ID: ${collectionInstance?.id}</div>
                <div>Name: ${collectionInstance?.name}</div>
                <div>Logo URL: ${collectionInstance?.logoUrl}</div>
                <div>Owner: ${collectionInstance?.owner.username}</div>

                <div>Created: <joda:format value="${collectionInstance?.dateCreated}" style="LL" /></div>
                <div>Last updated: <joda:format value="${collectionInstance?.lastUpdated}" style="LL" /></div>

                <div class="clear"></div>
<sec:ifAllGranted roles="ROLE_ADMIN">
                <div class="edit edit-item">
                    <g:link mapping="generic" action="edit" id="${collectionInstance?.id}" title="Edit item" class="edit-button">Edit</g:link>
                </div>
                <div class="edit delete-item">
                    <g:link action="delete" id="${collectionInstance?.id}" title="Delete item" class="edit-button"
                        onclick="return confirm('${message(code: 'default.button.delete.confirm.message')}');" >Delete</g:link>
                </div>
</sec:ifAllGranted>
            </div><!-- item-details -->

            <div class="clear"></div>
            <div class="rule"><hr /></div>

        </div>
    </body>
</html>
